$(function () {
	

	$.ajax({
        url: severUrl+'index.php?m=Web&a=research',
        type: 'GET',
        dataType: 'JSONP'
    })
    .done(function(data) {
        console.log("success");
        console.log(data);
        focusFun(data.focus)
        // BusinessMapFun(data.locations)

    })
    .fail(function() {
        console.log("error");
    })
    .always(function() {
        console.log("complete");
    });




// focus
 function focusFun(data){
 	var focusCon = $('#focusCon');
 	var  html = '' ;
 	for (var i = 0; i < data.length; i++) {

 		html+='<li><a href="javascript:void(0);"><img class="photo" data-in="'+i+'" src="'+data[i].image_url+'"></a></li>';

 	}
 	focusCon.html(html)

    focusCon.on('click', 'li', function(event) {
        var li = focusCon.find('li');
        var dateimg = [];
        var index = $(this).index();

        for (var i = 0; i < li.length; i++) {
            dateimg.push(li.eq(i).find('img').attr('src'));
        }
        PhotoPreviewFun(dateimg,index);
    });

 }
// focus end


})